//
//  OPMrestCookCell.m
//  OnePiece
//
//  Created by wsy on 15/10/29.
//  Copyright © 2015年 wsy. All rights reserved.
//

#import "OPMrestCookCell.h"
#import <UIImageView+WebCache.h>
@implementation OPMrestCookCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _picture = [[UIImageView alloc]initWithFrame:CGRectMake(10, 5, SCREEN_WIDTH-20, SCREEN_WIDTH*235/600)];
        [self.contentView addSubview:_picture];
        _name = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_WIDTH*235/600+10, SCREEN_WIDTH-100, 15)];
        _name.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_name];
        _desc = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_WIDTH*235/600+30, SCREEN_WIDTH-20, 15)];
        _desc.font = [UIFont systemFontOfSize:12];
        _desc.textColor = [UIColor colorWithWhite:0.265 alpha:1.000];
        [self.contentView addSubview:_desc];
    }
    return self;
}

- (void)setModel:(OPMrestCookModel *)model
{
    [_picture sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:[UIImage imageNamed:@"beijingImg.jpg"]];
    _name.text = model.name;
    _desc.text = model.summary;
}

@end
